/*https://leetcode.cn/problems/climbing-stairs/submissions/564732180/*/
class Solution {
public:
    int climbStairs(int n) {
        if(n <= 2)return n;
        int dp[n+1];//从1到n
        dp[1] = 1;//一种爬法
        dp[2] = 2;//两种爬法
        for(int i = 3;i <= n;i++){
            dp[i] = dp[i-1] + dp[i-2];
        }
        return dp[n];
    }
};